import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: 'index',
  redirect: '/login',
  component: Home,
  children: [{
      path: '/home',
      name: 'home',
      component: () => import('../components/Home.vue')
    },
    {
      path: '/tels',
      name: 'tels',
      component: () => import('../components/Tels.vue')
    }
  ]
},{
  path: '/login',
  name: 'login',
  component: () => import('../views/Login.vue')
}]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router